﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>短信设置</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/common-1.0.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>

</head>
<body>
<nav class="breadcrumb">
  <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 系统设置 
  <a class="btn btn-success radius r mr-20 btn-shua" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20">
  <div id="tab-system" class="HuiTab">
    <div class="tabBar cl">
      <foreach name="set_nav" item="vo" key="k">
        <span <if condition="$k eq 'sMes'">class="current"</if>><a href="javascript:void(0)" data-url="{:U('/Admin/Setup/index',array('type'=>$k))}" onclick="goset(this)">{$vo}</a></span>
      </foreach>     
    </div>
    <form action="" method="post" class="form form-horizontal" id="myform">
      <div class="tabCon">
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>注册启用短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="zhuce1" name="zhuce" value="1" <if condition='($conf[zhuce] eq 1)'>checked </if> ><label for="zhuce1">开启</label></div>
            <div class="radio-box"><input type="radio" id="zhuce2" name="zhuce" value="0" <if condition='($conf[zhuce] eq 0)'>checked </if> ><label for="zhuce2">关闭</label></div>
            <span style="color:#ccc">主要用于会员注册验证码发送。</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>注册成功短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="cheng1" name="cheng" value="1" <if condition='($conf[cheng] eq 1)'>checked </if> ><label for="cheng1">开启</label></div>
            <div class="radio-box"><input type="radio" id="cheng2" name="cheng" value="0" <if condition='($conf[cheng] eq 0)'>checked </if> ><label for="cheng2">关闭</label></div>
            <span style="color:#ccc">主要用于会员注册成功以后，给会员短信通知。</span>
          </div>
        </div>
        <!--<div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>交易验证短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="zheng1" name="zheng" value="1" <if condition='($conf[zheng] eq 1)'>checked </if> ><label for="zheng1">开启</label></div>
            <div class="radio-box"><input type="radio" id="zheng2" name="zheng" value="0" <if condition='($conf[zheng] eq 0)'>checked </if> ><label for="zheng2">关闭</label></div>
            <span style="color:#ccc">主要用于会员大厅交易验证通知使用。</span>
          </div>
        </div>-->
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>密码找回短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="pwds1" name="pwds" value="1" <if condition='($conf[pwds] eq 1)'>checked </if> ><label for="pwds1">开启</label></div>
            <div class="radio-box"><input type="radio" id="pwds2" name="pwds" value="0" <if condition='($conf[pwds] eq 0)'>checked </if> ><label for="pwds2">关闭</label></div>
            <span style="color:#ccc">主要用于会员密码找回使用。</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>用户下单短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="order1" name="order" value="1" <if condition='($conf[order] eq 1)'>checked </if> ><label for="order1">开启</label></div>
            <div class="radio-box"><input type="radio" id="order2" name="order" value="0" <if condition='($conf[order] eq 0)'>checked </if> ><label for="order2">关闭</label></div>
            <span style="color:#ccc">会员下单成功以后，给会员短信通知</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>订单发货短信：</label>
          <div class="formControls col-8 skin-minimal">
            <div class="radio-box"><input type="radio" id="fahuo1" name="fahuo" value="1" <if condition='($conf[fahuo] eq 1)'>checked </if> ><label for="fahuo1">开启</label></div>
            <div class="radio-box"><input type="radio" id="fahuo2" name="fahuo" value="0" <if condition='($conf[fahuo] eq 0)'>checked </if> ><label for="fahuo2">关闭</label></div>
            <span style="color:#ccc">管理员发货成功后，给会员短信通知</span>
          </div>
        </div>
        <div class="row cl">
          <div class="col-10 col-offset-2">
            <input type="hidden" id="type" name="type" value="{$type}">
      		<button type="button" id="sub" name="sub" class="btn btn-primary radius " onClick="checkSubmit()"><i class='Hui-iconfont'>&#xe632;</i>&nbsp;保存</button>
          </div>
		</div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
//按回车件触发提交
document.onkeydown=function(event){
	var e = event || window.event || arguments.callee.caller.arguments[0];
	if(e && e.keyCode==13){ // enter 键
		checkSubmit();
	}
}; 
//提交数据
function checkSubmit()
{
	var zhuce = $('input[name="zhuce"]:checked').val();
	var cheng = $('input[name="cheng"]:checked').val();
	var zheng = $('input[name="zheng"]:checked').val();
	var pwds  = $('input[name="pwds"]:checked').val();
	var order = $('input[name="order"]:checked').val();
	var fahuo = $('input[name="fahuo"]:checked').val();
	if(typeof(zhuce) == "undefined"){ 
		layer.msg('注册启用短信未选择', {icon: 2});
		return false;
	}if(cheng == ''){
		layer.msg('注册成功通知未选择!', {icon: 2});
		return false;
	}if(zheng == ''){
		layer.msg('身份认证短信未选择!', {icon: 2});
		return false;
	}if(pwds==''){
		layer.msg('密码找回短信未选择!', {icon: 2});
		return false;
	}if(order == ''){
		layer.msg('用户下单短信未选择!', {icon: 2});
		return false;
	}if(fahuo==''){
		layer.msg('订单发货短信未选择!', {icon: 2});
		return false;
	}
	$.ajax({
		type : 'post',
		url : '__MODULE__/Setup/setupUpdate',
		data : $("#myform").serialize(),
		dataType : 'json',
		success : function(res){
			if(res.status == 1){
				layer.msg(res.msg,{icon:1});
				window.location.href = res.url;
			}else{
				layer.msg(res.msg, {icon: 2});
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.alert('网络失败，请刷新页面后重试',{icon:2});
		}
	})
}
</script>
<!-- 单选 复选框 -->
<link href="__PUBLIC__/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});
</script>
<!-- 单选 复选框 -->
</body>
</html>